# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.DataCatalog.V1.Model.GoogleCloudDatacatalogV1PhysicalSchema do
  @moduledoc """
  Native schema used by a resource represented as an entry. Used by query engines for deserializing and parsing source data.

  ## Attributes

  *   `avro` (*type:* `GoogleApi.DataCatalog.V1.Model.GoogleCloudDatacatalogV1PhysicalSchemaAvroSchema.t`, *default:* `nil`) - Schema in Avro JSON format.
  *   `csv` (*type:* `GoogleApi.DataCatalog.V1.Model.GoogleCloudDatacatalogV1PhysicalSchemaCsvSchema.t`, *default:* `nil`) - Marks a CSV-encoded data source.
  *   `orc` (*type:* `GoogleApi.DataCatalog.V1.Model.GoogleCloudDatacatalogV1PhysicalSchemaOrcSchema.t`, *default:* `nil`) - Marks an ORC-encoded data source.
  *   `parquet` (*type:* `GoogleApi.DataCatalog.V1.Model.GoogleCloudDatacatalogV1PhysicalSchemaParquetSchema.t`, *default:* `nil`) - Marks a Parquet-encoded data source.
  *   `protobuf` (*type:* `GoogleApi.DataCatalog.V1.Model.GoogleCloudDatacatalogV1PhysicalSchemaProtobufSchema.t`, *default:* `nil`) - Schema in protocol buffer format.
  *   `thrift` (*type:* `GoogleApi.DataCatalog.V1.Model.GoogleCloudDatacatalogV1PhysicalSchemaThriftSchema.t`, *default:* `nil`) - Schema in Thrift format.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :avro =>
            GoogleApi.DataCatalog.V1.Model.GoogleCloudDatacatalogV1PhysicalSchemaAvroSchema.t()
            | nil,
          :csv =>
            GoogleApi.DataCatalog.V1.Model.GoogleCloudDatacatalogV1PhysicalSchemaCsvSchema.t()
            | nil,
          :orc =>
            GoogleApi.DataCatalog.V1.Model.GoogleCloudDatacatalogV1PhysicalSchemaOrcSchema.t()
            | nil,
          :parquet =>
            GoogleApi.DataCatalog.V1.Model.GoogleCloudDatacatalogV1PhysicalSchemaParquetSchema.t()
            | nil,
          :protobuf =>
            GoogleApi.DataCatalog.V1.Model.GoogleCloudDatacatalogV1PhysicalSchemaProtobufSchema.t()
            | nil,
          :thrift =>
            GoogleApi.DataCatalog.V1.Model.GoogleCloudDatacatalogV1PhysicalSchemaThriftSchema.t()
            | nil
        }

  field(:avro, as: GoogleApi.DataCatalog.V1.Model.GoogleCloudDatacatalogV1PhysicalSchemaAvroSchema)

  field(:csv, as: GoogleApi.DataCatalog.V1.Model.GoogleCloudDatacatalogV1PhysicalSchemaCsvSchema)
  field(:orc, as: GoogleApi.DataCatalog.V1.Model.GoogleCloudDatacatalogV1PhysicalSchemaOrcSchema)

  field(:parquet,
    as: GoogleApi.DataCatalog.V1.Model.GoogleCloudDatacatalogV1PhysicalSchemaParquetSchema
  )

  field(:protobuf,
    as: GoogleApi.DataCatalog.V1.Model.GoogleCloudDatacatalogV1PhysicalSchemaProtobufSchema
  )

  field(:thrift,
    as: GoogleApi.DataCatalog.V1.Model.GoogleCloudDatacatalogV1PhysicalSchemaThriftSchema
  )
end

defimpl Poison.Decoder, for: GoogleApi.DataCatalog.V1.Model.GoogleCloudDatacatalogV1PhysicalSchema do
  def decode(value, options) do
    GoogleApi.DataCatalog.V1.Model.GoogleCloudDatacatalogV1PhysicalSchema.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.DataCatalog.V1.Model.GoogleCloudDatacatalogV1PhysicalSchema do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
